<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <title>学生个人信息</title>
    <link rel="shortcut icon" href="../../image/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="../../css/main.css" media="all">
    <link rel="stylesheet" href="../../css/main.css" media="all">
    <!--  测试测试测试测试  -->
</head>
<body class="layui-layout-body" style="overflow: hidden">
<div class="layui-layout layui-layout-admin">
    <!-- 头部区域 -->
    <div class="layui-header">
        <div class="layui-col-xs1 layui-col-sm1 layui-col-md1">&nbsp;</div>
        <!-- 头部区域 -->
        <div class="layui-col-xs4 layui-col-sm6 layui-col-md6">
            <div style="display:inline-block;margin-left: 20px;">
                <img src="../../image/logo.png" height="50px" style="padding-top: 5px;cursor:pointer" title="首页"
                     onclick="window.open('index.html', '_top', '', 'true')">
            </div>
        </div>

        <div class="layui-col-xs6 layui-col-sm4 layui-col-md4">
            <ul class="layui-nav" align="right" lay-filter="layadmin-layout-right">
                <li class="layui-nav-item layui-hide-xs" lay-unselect>
                    <a href="studentResume.html" layadmin-event="flexible" target="student">
                        上传简历
                    </a>
                </li>
                <li class="layui-nav-item" lay-unselect>
                    <a href="javascript:;">
                        <img id="stuimg" src="../../image/avatar.png" class="layui-nav-img">
                        <cite id="stuname">贤心</cite>
                    </a>
                    <dl class="layui-nav-child">
                        <dd><a href="personalInformation.html" target="student">基本资料</a></dd>
                        <dd><a href="checkpwd.html">修改密码</a></dd>
                        <hr>
                        <dd id="logout" layadmin-event="logout" style="text-align: center;"><a>退出</a></dd>
                    </dl>
                </li>

                <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-unselect>
                    <a href="javascript:;" layadmin-event="more"><i class="layui-icon layui-icon-more-vertical"></i></a>
                </li>
            </ul>
        </div>
        <div class="layui-col-xs1 layui-col-sm1 layui-col-md1">&nbsp;</div>
    </div>

    <!-- 侧边栏   -->
    <div class="layui-side layui-bg-black">
        <ul class="layui-nav layui-nav-tree layui-inline" style="margin-right: 10px;">
            <li class="layui-nav-item layui-this"><a href="personalInformation.html" target="student">我的信息</a></li>
            <li class="layui-nav-item"><a href="stuFamilyMember.html" target="student">家庭成员</a></li>
            <li class="layui-nav-item"><a href="studentintentional.html" target="student">就业意向</a></li>
            <li class="layui-nav-item"><a href="studentEvent.html" target="student">校内经历</a></li>
            <li class="layui-nav-item"><a href="studentPosition.html" target="student">我的投递</a></li>
            <li class="layui-nav-item"><a href="studentResume.html" target="student">简历中心</a></li>
            <li class="layui-nav-item"><a href="studentAchievement.html" target="student">专业成绩</a></li>
        </ul>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <iframe src="personalInformation.html" name="student" frameborder="0" height="100%" width="100%"></iframe>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        <div class="layui-container">
            <div class="layui-row">
                <div class="layui-col-md12" style="text-align: center;font-size: 16px">
                    Copyright © 1999-2020 云南工商学院
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../../libs/layui/layui.js"></script>
<script>
    layui.use(['form', 'element', 'layer', 'okLayer', 'jquery'], function () {
        let element = layui.element;
        let layer = layui.layer;
        let okLayer = layui.okLayer;
        let $ = layui.jquery;
        element.on('nav(demo)', function (elem) {
            // console.log(elem)
            layer.msg(elem.text());
        });
        // 获取contentText
        const ctx = function () {
            let pathName = document.location.pathname;
            let index = pathName.substr(1).indexOf("/");
            let result = pathName.substr(0, index + 1);
            return result;
        }();
        // 获取enterprise
        var student = JSON.parse(window.sessionStorage.getItem("student"));
        var url = ctx + "/pages/student/studentLogin.html";
        if (student == null) {
            okLayer.yellowSighMsg("登陆时间超时，请重新登录！", function () {
                window.sessionStorage.clear();
                window.open(url, "_top", "", "true");
            });
        }
        initializationdata();

        //退出登录
        $("#logout").bind('click', function () {
            window.sessionStorage.clear();
            window.open(url, "_top", "", "true");
        })

        //初始化数据
        function initializationdata() {
            $.ajax({
                url: ctx + '/ygssecs/getstudentbyid',
                type: 'get',
                dataType: 'json',
                data: {stuid: student.stuid}
            }).done(function (res) {
                var studata = res.data;
                $("#stuname").html(studata.realname)
                $("#stuimg").attr('src', studata.photo);
            }).fail(function (e) {
                console.log(e)
            })
        }
    });
</script>
</body>
</html>